package net.javastone.toolkit.robot.dingding.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * Created by sdliang on 2018/11/6.
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DingDingRequest {

  /**
   * 消息类型
   */
  private String msgtype;
  /**
   * 提醒用户
   */
  private At at;
  /**
   * 文字消息
   */
  private Text text;
  /**
   * 连接消息
   */
  private Link link;
  /**
   * 格式化消息
   */
  private Markdown markdown;

  /**
   * 消息类型
   */
  public enum MsgType {
    TEXT,
    LINK,
    MARKDOWN
  }

  @Setter
  @Getter
  @AllArgsConstructor
  @NoArgsConstructor
  public static class At {

    private boolean isAtAll;
    private String[] atMobiles;
  }

  @Setter
  @Getter
  @AllArgsConstructor
  @NoArgsConstructor
  public static class Text {

    private String content;

  }

  @Setter
  @Getter
  @AllArgsConstructor
  @NoArgsConstructor
  public static class Link {

    private String title;
    private String text;
    private String picUrl;
    private String messageUrl;

  }

  @Setter
  @Getter
  @AllArgsConstructor
  @NoArgsConstructor
  public static class Markdown {

    private String title;
    private String text;

  }

}
